package cn.vc.auth.feign.clients;

import cn.vc.basicmodule.entity.Result;
import cn.vc.auth.entity.po.VUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient("auth-service")
public interface LogInClient {
    /**
     * <h2>注册</h2>
     * @return
     */
    @PostMapping
    Result<VUser> signIn(@RequestParam("captcha") String captcha, @RequestBody VUser user);

    /**
     * <h2>登出</h2>
     * @return
     */
    @DeleteMapping
    Result<?> logOut();

    /**
     * <h2>登录</h2>
     * @param account
     * @param password
     * @return
     */
    @GetMapping("/login")
    Result<?> logIn(@RequestParam("account") String account, @RequestParam("password") String password);

    /**
     * <h2>忘记密码</h2>
     * @param email
     * @param captcha
     * @param newPassword
     * @return
     */
    @PutMapping
    Result<?> forgotPassword(@RequestParam("email") String email, @RequestParam("captcha") String captcha, @RequestParam("newPassword") String newPassword);
}
